<template>
	<view @click="goPurchase" class="goodsListItem-container">
		<view class="goodsListItem">
			<view class="flex top flex-items-center">
				<view class="name flex-1 txtov">{{item.name}}</view>
				<view class="specifications">约{{item.weight}}</view>
			</view>
			<view class="flex footer flex-items-center">
				<view class="merchant flex-1 ">
					<view class="name txtov">{{item.providerName}}</view>
					<view class="number">{{item.id}}</view>
				</view>
				<view class="button">
					采购
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	let {
		item
	} = defineProps({
		item: {
			type: Object,
			default: () => null
		}
	})
	onMounted(()=>{
		console.log(item,'=====')
	})
	function goPurchase() {
		uni.navigateTo({
			url: `/pages/goods/pages/purchase/index?item=${encodeURIComponent(JSON.stringify(item))}`
		})
	}
</script>

<style lang="scss" scoped>
	@import 'index.scss';
</style>